﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!-- Resource dictionary entries should be defined here. -->


    <Style x:Key="{x:Type ProgressBar}" TargetType="{x:Type ProgressBar}">
        <Setter Property="Foreground" Value="{DynamicResource MetroProgressDark}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <Grid x:Name="ProgressBar">
                        <Border x:Name="PART_Track" Background="{x:Null}" />
                        <Decorator x:Name="PART_Indicator" HorizontalAlignment="Left">
                            <Grid x:Name="Foreground">
                                <Rectangle x:Name="Indicator" Fill="{TemplateBinding Foreground}" />
                                <Grid x:Name="Animation" ClipToBounds="True">
                                    <Border x:Name="PART_GlowRect" HorizontalAlignment="Left" Margin="-100,0,0,0" Width="100" Background="{TemplateBinding Foreground}" CacheMode="BitmapCache" />
                                </Grid>
                            </Grid>
                        </Decorator>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsIndeterminate" Value="True">
                            <Setter TargetName="Indicator" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsIndeterminate" Value="False">
                            <Setter TargetName="PART_GlowRect" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="Orientation" Value="Vertical">
                            <Setter Property="LayoutTransform" TargetName="ProgressBar">
                                <Setter.Value>
                                    <RotateTransform Angle="-90" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>